home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / wgt35.zip / WGT35.DOC < prev    next >
Text File  |  1993-01-28  |  57KB  |  1,945 lines

  1.          WordUp Graphics Toolkit V3.5 Command Reference
  2.                 Page 1
  3.              Copyright 1993 Chris Egerter
  4.  
  5.  
  6.         
  7.                WordUp Graphics Toolkit
  8.               Command Reference
  9.  
  10. This document contains all of the available procedures within the
  11. main WGT3.LIB library file. Documentation for WGT menus, scrolling,
  12. and FLI playing are in their own files.
  13.  
  14. This document is set up to print 66 lines per page. Please report any
  15. errors, typos, or unclear functions to WordUp Software Productions.
  16.  
  17. All procedures are meant for use in the Large memory model.
  18.  
  19.                          Index:
  20.                          ~~~~~~
  21. Video Initialization
  22. ~~~~~~~~~~~~~~~~~~~~
  23. vga256............................................4
  24.  
  25. Graphics Primitives
  26. ~~~~~~~~~~~~~~~~~~~
  27. wbar..............................................4
  28. wbutt.............................................4
  29. wcircle...........................................4
  30. wclip.............................................5
  31. wcls..............................................5
  32. wfastputpixel.....................................5
  33. wfill_circle......................................5
  34. wfline............................................6
  35. wgetpixel.........................................6
  36. wline.............................................6
  37. wputpixel.........................................6
  38. wrectangle........................................6
  39. wregionfill.......................................7
  40. wretrace..........................................7
  41. wstyleline........................................7
  42.  
  43.  
  44. Colour and Palette
  45. ~~~~~~~~~~~~~~~~~~
  46. wcolrotate........................................8
  47. wfade_in..........................................8
  48. wfade_out.........................................8
  49. wloadpalette......................................8
  50. wreadpalette......................................9
  51. wremap............................................9
  52. wsavepalette......................................9
  53. wsetcolor.........................................9
  54. wsetpalette.......................................10
  55. wsetrgb...........................................10
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.         WordUp Graphics Toolkit Command Reference
  68.                 Page 2
  69.  
  70. Block Manipulation
  71. ~~~~~~~~~~~~~~~~~~
  72. wflipblock........................................11
  73. wfreeblock........................................11
  74. wgetblockheight...................................11
  75. wgetblockwidth....................................11
  76. wloadblock........................................12
  77. wloadcel..........................................12
  78. wloadpak..........................................12
  79. wloadpcx256.......................................13
  80. wnewblock.........................................13
  81. wputblock.........................................14
  82. wsaveblock........................................14
  83. wsavecel..........................................14
  84. wsavepak..........................................15
  85. wsavepcx256.......................................15
  86.  
  87. Mouse Functions
  88. ~~~~~~~~~~~~~~~
  89. minit.............................................15
  90. moff..............................................15
  91. mon...............................................16
  92. mouseshape........................................16
  93. mread.............................................17
  94. msetbounds........................................17
  95. msetspeed.........................................17
  96. msetthreshhold....................................18
  97. noclick...........................................18
  98.  
  99. Screen Operations
  100. ~~~~~~~~~~~~~~~~~
  101. wcopyscreen.......................................19
  102. wnormscreen.......................................19
  103. wsetscreen........................................19
  104.  
  105. Text functions
  106. ~~~~~~~~~~~~~~
  107. wflashcursor......................................20
  108. wfreefont.........................................20
  109. wgettextheight....................................20
  110. wgettextwidth.....................................20
  111. wgtprintf.........................................21
  112. wloadfont.........................................21
  113. wouttextxy........................................21
  114. wsetcursor........................................22
  115. wstring...........................................22
  116. wtextbackground...................................23
  117. wtextcolor........................................23
  118. wtextgrid.........................................23
  119. wtexttransparent..................................24
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.         WordUp Graphics Toolkit Command Reference
  133.                 Page 3
  134.  
  135.  
  136. Special Effects
  137. ~~~~~~~~~~~~~~~
  138. wfade.............................................24
  139. wmovescreen.......................................24
  140. wpan..............................................24
  141. wresize...........................................25
  142. wskew.............................................25
  143. wsline............................................25
  144. wvertres..........................................25
  145. wwarp.............................................26
  146. wwipe.............................................27
  147.  
  148. Sprite Procedures
  149. ~~~~~~~~~~~~~~~~~
  150. wloadsprites......................................27
  151. wfreesprites......................................27
  152.  
  153. WGT Library
  154. ~~~~~~~~~~~
  155. setlib procedure..................................28
  156. getlib procedure..................................28
  157. setpassword procedure.............................28
  158. lib2buf procedure.................................29
  159.  
  160. Timing Control
  161. ~~~~~~~~~~~~~~
  162. wtimer............................................29
  163.  
  164. Joystick Functions
  165. ~~~~~~~~~~~~~~~~~~
  166. wcheckjoystick....................................29
  167. winitjoystick.....................................29
  168. wcalibratejoystick................................30
  169. wreadjoystick.....................................30
  170.  
  171. Additional Library documents:
  172. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  173. Multidirectional scrolling........................scroll.doc
  174. SoundBlaster Routines.............................wgtsb.doc
  175. Custom Drop Down Menus............................wgtmenu.doc
  176. Additional Font Information.......................font.doc
  177. FLI playing routines..............................wgtfli.doc
  178. Static Background Sprites.........................wspr.doc
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.         WordUp Graphics Toolkit Command Reference
  199.                 Page 4
  200.  
  201. Initialization:
  202. ~~~~~~~~~~~~~~~
  203.  
  204. vga256 procedure
  205. ------------------------------------------------------------------------------
  206. Function  Initializes the 320x200x256 color graphics mode.
  207.  
  208. Declaration    void vga256(void)
  209.  
  210. Remarks        This command must be called before any other graphics commands
  211.           are called or they WILL NOT work.
  212.  
  213.  
  214.  
  215. Graphics Primitives:
  216. ~~~~~~~~~~~~~~~~~~~~
  217.  
  218. wbar procedure
  219. ------------------------------------------------------------------------------
  220. Function  Draws a filled rectangle with current color on active graphics
  221.           page.
  222.  
  223. Declaration    void wbar(int x1,int y1,int x2,int y2)
  224.  
  225. Remarks        See wrectangle.
  226.  
  227.  
  228.  
  229. wbutt procedure
  230. ------------------------------------------------------------------------------
  231. Function  Draws a 3-Dimensional button, using colours 253-255.
  232.  
  233. Declaration    void wbutt(int x1,int y1,int x2,int y2)
  234.  
  235. Remarks   (x1,y1) define the upper left corner of the button, and
  236.       (x2,y2) define the lower right.
  237.  
  238. See also  wsetcolor, wbar
  239.  
  240.  
  241.  
  242. wcircle procedure
  243. ------------------------------------------------------------------------------
  244. Function  Draws a circle using (x,y) as the center point.
  245.           Operates on current color and graphics page.
  246.  
  247. Declaration    void wcircle(int x,int y,int radius)
  248.  
  249. Remarks        The circle is drawn using the current color set by wsetcolor.
  250.           Aspect ratios are not used, therefore results may be slightly
  251.           different than the BGI counterpart.
  252.  
  253. See also  wsetcolor, wfill_circle
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.         WordUp Graphics Toolkit Command Reference
  265.                 Page 5
  266.  
  267.  
  268. wclip procedure
  269. ------------------------------------------------------------------------------
  270. Function  Sets the current clipping area for all graphics pages.
  271.  
  272. Declaration    void wclip(int x1,int y1,int x2,int y2)
  273.  
  274. Remarks        (x1,y1) define the upper left corner of the clipping area,
  275.           and (x2,y2) defines the lower right. Most WGT drawing
  276.           commands will draw within this boundary with a few
  277.           exceptions.
  278.           Set coordinates to (0,0,319,199) to disable clipping.
  279.  
  280.  
  281.  
  282. wcls procedure
  283. ------------------------------------------------------------------------------
  284. Function  Clears the currently selected graphics page with a specified
  285.           colour number.
  286.  
  287. Declaration    void wcls(int colour)
  288.  
  289. Remarks        This command behaves like the BGI ClearDevice procedure except
  290.           that it allows you to use a certain "clearing" color and it
  291.           supports WGT's multiple graphics pages.
  292.  
  293. Restrictions   Clears entire page ignoring clipping.
  294.  
  295. See also  wsetscreen,wnormscreen
  296.  
  297.  
  298.  
  299. wfastputpixel procedure
  300. -------------------------------------------------------------------------------
  301. Function  Plots a pixel at X,Y. Operates on current graphics page.
  302.  
  303. Declaration    void wputpixel(int x,int y)
  304.  
  305. Remarks        Same as wputpixel only it ignores clipping. This is the
  306.           fastest pixel plotting method.
  307.  
  308. See also  wgetpixel,wputpixel
  309.  
  310.  
  311.  
  312. wfill_circle procedure
  313. ------------------------------------------------------------------------------
  314. Function  Draws a filled circle using (x,y) as the center point.
  315.  
  316. Declaration    void wfill_circle(int x,int y,int radius)
  317.  
  318. Remarks        See wcircle
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.         WordUp Graphics Toolkit Command Reference
  331.                 Page 6
  332.  
  333.  
  334. wfline procedure
  335. ------------------------------------------------------------------------------
  336. Function  Draws a fast line on the current graphics page from (x1,y1) to
  337.       (x2,y2). Operates on current color and graphics page.
  338.       No clipping is performed.
  339.  
  340. Declaration    void wline(int x1,int y1,int x2,int y2)
  341.  
  342. See also  wline
  343.  
  344.  
  345.  
  346. wgetpixel procedure
  347. -------------------------------------------------------------------------------
  348. Function  Gets the pixel value at X,Y. Uses current graphics page.
  349.  
  350. Declaration    int wgetpixel(int x,int y);
  351.  
  352. See also  wputpixel
  353.  
  354.  
  355.  
  356. wline procedure
  357. ------------------------------------------------------------------------------
  358. Function  Draws a line on the current graphics page from (x1,y1) to
  359.           (x2,y2). Operates on current color and graphics page.
  360.  
  361. Declaration    void wline(int x1,int y1,int x2,int y2)
  362.  
  363. Remarks        Replaces all needs for BGI's line command except where a
  364.           line style other than Solid_Line is required. Horizontal lines
  365.           are significantly faster than BGI's.
  366.  
  367. See also  wsetcolor,wfline,wstyleline
  368.  
  369.  
  370.  
  371. wputpixel procedure
  372. -------------------------------------------------------------------------------
  373. Function  Plots a pixel at X,Y. Operates on current graphics page.
  374.  
  375. Declaration    void wputpixel(int x,int y)
  376.  
  377. Remarks        Plots a point in the current drawing color (set by wsetcolor)
  378.           at (x,y).
  379.           
  380. See also  wgetpixel
  381.  
  382.  
  383.  
  384.  
  385. wrectangle procedure
  386. ------------------------------------------------------------------------------
  387. Function  Draws a rectangle using the current color and graphics page.
  388.  
  389. Declaration    void wrectangle(int x1,int y1,int x2,int y2)
  390.  
  391. Remarks   (x1,y1) define the upper left corner of the rectangle, and
  392.           (x2,y2) define the lower right. Faster than BGI equivalent.
  393.  
  394. See also  wsetcolor, wbar
  395.  
  396.         WordUp Graphics Toolkit Command Reference
  397.                 Page 7
  398.  
  399.  
  400. wregionfill procedure
  401. ------------------------------------------------------------------------------
  402. Function  Fills an area of the screen bounded by any color other than
  403.           that located at (x,y).
  404.  
  405. Declaration    void wregionfill(int x,int y)
  406.  
  407. Remarks        Much more useful than the BGI FloodFill routine. It allows
  408.           multiple colors to be used as the border color. You must make
  409.           sure the stack size is large enough to handle complex fills.
  410.           If you get a stack overflow error, put this line at the
  411.           start of your program:
  412.       unsigned _stklen= (a number of bytes for the stack,64000 max)
  413.           See example program 8 (wgt08.c) for an example of this.          
  414.  
  415. See also  wsetcolor
  416.  
  417.  
  418.  
  419. wretrace procedure
  420. ------------------------------------------------------------------------------
  421. Function       Waits for the vertical retrace.
  422.  
  423. Declaration    void wretrace(void)
  424.  
  425. Remarks        Use when you get flickering graphics. This waits for the
  426.             vertical retrace on your monitor, so you can write
  427.             to the screen and time it with your monitor. It will
  428.             not work perfectly unless you are writing small amounts
  429.             to the screen, but it is worth a try if you get flickering
  430.             screens.
  431.  
  432.  
  433. wstyleline procedure
  434. ------------------------------------------------------------------------------
  435. Function  Draws a styled line on the current graphics page from (x1,y1) to
  436.       (x2,y2). Operates on current color and graphics page.
  437.  
  438. Declaration    void wstyleline(int x1,int y1,int x2,int y2,unsigned in patt)
  439.  
  440. Remarks       Enables a line with different patterns. Patt is an unsigned
  441.          int, which means there are 16 bits you can turn on or off.
  442.          Each bits represents a pixel in the line turned on or off.
  443.          A value of 0 would show no line, while 65535 would be solid.
  444.  
  445.  
  446. See also  wsetcolor,wline,wfline
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.         WordUp Graphics Toolkit Command Reference
  463.                 Page 8
  464.  
  465. Color Manipulation:
  466. ~~~~~~~~~~~~~~~~~~~
  467.  
  468. wcolrotate procedure
  469. ------------------------------------------------------------------------------
  470. Function  Cycles the colors within a specified group from a palette
  471.           variable.
  472.  
  473. Declaration    void wcolrotate(int start,int finish,int dir,color palette[256])
  474.  
  475. Remarks        This routine takes the colors from Start to Finish and shifts
  476.           them one in the direction specified by direction. Direction
  477.           can either be 0 for up, or 1 for down. This effect can
  478.           be used to simulate animation.
  479.  
  480. See also  wsetrgb, wfade_in, wfade_out
  481.  
  482.  
  483. wfade_in  Procedure
  484. ------------------------------------------------------------------------------
  485. Function  Gradually fades in a group of colors from a palette variable
  486.           (using a specified speed).
  487.  
  488. Declaration    void wfade_in(int start,int finish,int speed, color palette[256]);
  489.  
  490. Remarks        The colors from Start to Finish are faded in starting from
  491.           black. The speed may range from (0..255), and is similar to
  492.       using the DELAY command between each change of the colors.
  493.       The palette array is restored after the fading is finished.
  494.  
  495. See also  wfade_out, wsetrgb, wsetpalette
  496.  
  497.  
  498.  
  499. wfade_out procedure
  500. ------------------------------------------------------------------------------
  501. Function  Gradually fades out a group of colors from a palette variable
  502.           (using a specified speed).
  503.  
  504. Declaration    void wfade_out(int start,int finish,int speed,color palette[256]);
  505.  
  506. Remarks        Same as wfade_in except colors fade from palette to black.
  507.  
  508. See also  wfade_in, wsetrgb, wsetpalette
  509.  
  510.  
  511.  
  512. wloadpalette procedure
  513. ------------------------------------------------------------------------------
  514. Function  Load a 768 byte palette file from disk into a palette
  515.           variable.
  516.  
  517. Declaration    void wloadpalette(char *filename,color *palette)
  518.  
  519. Remarks        Palette files created by WGT or popular graphics programs may
  520.           be loaded into the variable specified by palette. Changes are not
  521.           made to the currently displayed palette. A good example of
  522.           compatibility would be the AutoDesk Animator. It's .COL files
  523.           are of this type. Many commercial games use these files as
  524.           well.
  525.  
  526. See also  wsavepalette, wsetpalette, wsetrgb
  527.  
  528.         WordUp Graphics Toolkit Command Reference
  529.                 Page 9
  530.  
  531.  
  532. wreadpalette procedure
  533. ------------------------------------------------------------------------------
  534. Function  Reads the palette into memory.
  535.  
  536. Declaration    void wreadpalette(int start,int finish, color *palette)
  537.  
  538. Remarks        Start and Finish can range from 0 to 255.
  539.           Stores the palette info into your palette array.
  540.  
  541. See also  wsetpalette, wloadpalette, wsavepalette, wsetcolor
  542.  
  543.  
  544. wremap procedure
  545. ------------------------------------------------------------------------------
  546. Function  Remaps the colours of a block or the visual screen to a new
  547.       palette.
  548.  
  549. Declaration    void wremap(color pal1[256],block remapblock,color pal2[256])
  550.  
  551. Remarks        Pal1 is the palette of the correct palette belonging to 
  552.            block remapblock.  Pal2 contains the new palette the block
  553.            will use after remapping.  This changes every pixel
  554.            in the block from the normal palette, to the closest colour
  555.            from the new palette pal2.
  556.            If remapblock is NULL, the visual screen is used.
  557.  
  558. See also  wloadpalette, wloadblock
  559.  
  560.  
  561.  
  562. wsavepalette procedure
  563. ------------------------------------------------------------------------------
  564. Function  Save a palette variable's contents to a disk file.
  565.  
  566. Declaration    void wsavepalette(char *filename, color *palette);
  567.  
  568. Remarks        Creates a 768 byte palette file to disk from a variable
  569.           specified by palette. This is useful for storing different
  570.           palettes for games and their various screens.
  571.  
  572. See also  wloadpalette, wsetpalette, wsetrgb
  573.  
  574.  
  575.  
  576.  
  577. wsetcolor procedure
  578. ------------------------------------------------------------------------------
  579. Function  Sets the current drawing color using the palette.
  580.  
  581. Declaration    void wsetcolor(int color)
  582.  
  583. Remarks        Color may be in the range (0..255). All drawing procedures
  584.           used after setting this will use the color you choose.
  585.  
  586. See also  wsetrgb,wsetpalette,wloadpalette,wsavepalette
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.         WordUp Graphics Toolkit Command Reference
  595.                 Page 10
  596.  
  597.  
  598. wsetpalette procedure
  599. ------------------------------------------------------------------------------
  600. Function  Sets a group of colors from a specified palette variable.
  601.  
  602. Declaration    void wsetpalette(int start,int finish, color *palette)
  603.  
  604. Remarks        Colors from Start to Finish are set using the values stored
  605.           in the Palette variable. The variable type PALETTE is
  606.           specific to WGT and may not be used elsewhere. It is
  607.           defined as follows:
  608.  
  609.                typedef struct {
  610.                unsigned char r,g,b;
  611.                } color;
  612.  
  613.           To define a palette, you must make an array of colors like
  614.           this:
  615.  
  616.           color palette[256];
  617.  
  618.           The Red,Green, and Blue values are in the range (0..63)
  619.           giving a total of 262144 color combinations possible.
  620.  
  621. See also  wsetrgb, wloadpalette, wsavepalette, wsetcolor
  622.  
  623.  
  624.  
  625. wsetrgb procedure
  626. ------------------------------------------------------------------------------
  627. Function  Sets a color's red, green, and blue values.
  628.  
  629. Declaration    void wsetrgb(int color,int red,int green, int blue, color *palette)
  630.  
  631. Remarks        Color can range from 0 to 255.
  632.           The Red,Green, and Blue values are in the range (0..63)
  633.           giving a total of 262144 color combinations possible.
  634.           
  635.           The colors do NOT change until you give a wsetpalette
  636.           command.  This way you can set a number of colors
  637.           and change them at the same time.
  638.  
  639.           Since the palette is stored as an array, not a pointer, you
  640.           must use the & sign when you pass the palette. EG:
  641.  
  642.           color palette[256];  // palette defined
  643.           wsetrgb(1,63,63,63,&palette); // sets color 1 to white
  644.  
  645. See also  wsetpalette, wloadpalette, wsavepalette, wsetcolor
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.         WordUp Graphics Toolkit Command Reference
  661.                 Page 11
  662.  
  663.  
  664. Block Manipulation:
  665. ~~~~~~~~~~~~~~~~~~~
  666.  
  667. wflipblock procedure
  668. ------------------------------------------------------------------------------
  669. Function  Flips a block in one of two directions (block is physically
  670.           changed in memory, not on screen).
  671.  
  672. Declaration    void wflipblock(block blockname, int direction);
  673.  
  674. Remarks        This procedure will flip a previously stored image either
  675.           vertically or horizontally. The stored image is physically
  676.           changed, and therefore the results will not be seen until
  677.           the block is displayed.
  678.  
  679.           direction is defined as the following:
  680.  
  681.           #define vertical 0;
  682.           #define horizontal 1;
  683.  
  684.  
  685. See also  wputblock, wnewblock, wresizeblock, wfreeblock
  686.  
  687.  
  688. wfreeblock procedure
  689. ------------------------------------------------------------------------------
  690. Function  Releases memory used to store an image.
  691.  
  692. Declaration    void wfreeblock(block blockname)
  693.  
  694. Remarks        Used when a program is finished with a stored image. This is
  695.       similar to the BGI farfree. You must use this to free memory
  696.           from all blocks previously allocated by wnewblock or other
  697.           block loading procedures before you exit your program,
  698.           or you will encounter memory errors.
  699.  
  700. See also  wnewblock
  701.  
  702.  
  703. wgetblockheight procedure
  704. ------------------------------------------------------------------------------
  705. Function  Returns height of a previously stored block.
  706.  
  707. Declaration    int wgetblockheight(block blockname);
  708.  
  709.  
  710.  
  711. wgetblockwidth procedure
  712. ------------------------------------------------------------------------------
  713. Function  Returns width of a previously stored block.
  714.  
  715. Declaration    int wgetblockwidth(block blockname);
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.         WordUp Graphics Toolkit Command Reference
  727.                 Page 12
  728.  
  729.  
  730. wloadblock procedure
  731. ------------------------------------------------------------------------------
  732. Function  Loads a previously saved image from disk into a pointer.
  733.  
  734. Declaration    block wloadblock(char *filename)
  735.  
  736. Remarks        wloadblock automatically initializes the appropriate amount
  737.           of memory and loads the data. There is no need for a call
  738.           to wnewblock (in fact, don't do it or this won't work).
  739.  
  740. Returns:  Pointer to the loaded block. If the block could not be
  741.           found on disk, it returns NULL.
  742.  
  743. See also  wsaveblock
  744.  
  745.  
  746.  
  747. wloadcel procedure
  748. ------------------------------------------------------------------------------
  749. Function  Loads a CEL file (320*200*256 only) into a block.
  750.  
  751. Declaration    block wloadcel(char *filename, color *palette);
  752.  
  753. Remarks        The file MUST be in 320x200x256 color mode. New
  754.           Animator Pro CELs can use higher modes and they will not
  755.           work. Automatically allocates memory for the block when
  756.           you load in the CEL.
  757.  
  758.  
  759.  
  760. wloadpak procedure
  761. ------------------------------------------------------------------------------
  762. Function  Loads a previously stored image from disk in compressed
  763.           format.
  764.  
  765. Declaration    block wloadpak(char *filename)
  766.  
  767. Remarks        This is similar to wloadblock except that the image is
  768.           in a file which was created by wsavepak. The compression used
  769.           is "similar" to PCX format (sometimes better). The more
  770.           simplistic the image, the smaller the file.
  771.  
  772. Returns:  Pointer to the loaded block. If the block could not be
  773.           found on disk, it returns NULL.
  774.  
  775. See also  wsavepak, wloadblock
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.         WordUp Graphics Toolkit Command Reference
  793.                 Page 13
  794.  
  795.  
  796. wloadpcx256 procedure
  797. ------------------------------------------------------------------------------
  798. Function  Loads a PCX file (320*200*256 only) onto the current graphics
  799.           page.
  800.  
  801. Declaration    block wloadpcx256(char *filename, color *palette);
  802.  
  803. Remarks        The file can be any size and must be in 256 color mode.
  804.       New version looks for the palette at the end of the PCX file.
  805.       Some PCX pictures have older formats, depending on
  806.       what program created them. For this reason, try not to
  807.       depend on PCX pictures too much, and find other methods
  808.       such as CEL, or GIF2BLK to import pictures.
  809.  
  810.  
  811. wnewblock procedure
  812. ------------------------------------------------------------------------------
  813. Function  Stores a section of the screen in memory at a location pointed
  814.           to by a pointer variable.
  815.  
  816. Declaration    block wnewblock(int x1,int y1,int x2,int y2)
  817.  
  818. Remarks        Dynamic memory is used to automatically calculate the size of
  819.           the data, and to store it in a format compatible with BGI's
  820.           GETIMAGE. This procedure replaces the need for the combination
  821.           of IMAGESIZE, FARMALLOC, and GETIMAGE used in the BGI (although
  822.           all of WGT's block commands may be used  with
  823.           the BGI versions). Simply define a block at the beginning of
  824.           your program and call this routine.
  825.  
  826.           example:
  827.           block something;
  828.           void main(void)
  829.            {
  830.            ...
  831.            something=wnewblock(50,50,60,60);
  832.            ...
  833.            }
  834.  
  835. See also  wgetblockwidth, wgetblockheight, wflipblock, wputblock,
  836.           wresizeblock, wfreeblock, wloadblock, wsaveblock, wloadpak,
  837.           wsavepak
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.         WordUp Graphics Toolkit Command Reference
  859.                 Page 14
  860.  
  861. wputblock procedure
  862. ------------------------------------------------------------------------------
  863. Function  Plots a previously stored image on the current graphics page.
  864.  
  865. Declaration    void wputblock(int x,int y, block blockname, int mode)
  866.  
  867. Remarks        This is similar to the BGI PUTIMAGE. It displays an image
  868.           starting from the upper left corner at (x,y). Two modes are
  869.           supported for the method. They are:
  870.  
  871.           0 = Normal
  872.           1 = XRay
  873.  
  874.           The XRay uses the 0 color as a sort of
  875.           "see-through" color. Any occurrence of this color is not
  876.           drawn on the screen. This is useful for drawing sprites
  877.           which overlay a background screen.
  878.  
  879. See also  wnewblock
  880.  
  881.  
  882.  
  883. wsaveblock procedure
  884. ------------------------------------------------------------------------------
  885. Function  Saves a previously stored image to a file on disk.
  886.  
  887. Declaration    int wsaveblock(char *filename, block blockname)
  888.  
  889. Remarks        A file is created which holds the data stored at the pointer
  890.           given by BLOCKNAME. This allows your programs to load in
  891.           images for use later.
  892.  
  893. Returns:  0 if successful, 1 if it could not save the file
  894.  
  895. See also  wloadblock, wnewblock, wfreeblock
  896.  
  897.  
  898.  
  899. wsavecel procedure
  900. ------------------------------------------------------------------------------
  901. Function  Saves a CEL file 
  902.  
  903. Declaration    void wsavecel(char *filename,block saveblock,color palette[256]);
  904.  
  905. Remarks        This allows you to easily save a block into the CEL format,
  906.           so you can load them into AutoDesk's Animator.
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.         WordUp Graphics Toolkit Command Reference
  925.                 Page 15
  926.  
  927.  
  928. wsavepak procedure
  929. ------------------------------------------------------------------------------
  930. Function  Saves a block to disk in compressed format.
  931.  
  932. Declaration    int wsavepak(char *filename,block blockname)
  933.  
  934. Remarks        This is similar to wsaveblock except that the image is
  935.           in a file which is compressed. The compression used
  936.           is "similar" to PCX format (sometimes better). The more
  937.           simplistic the image, the smaller the file. The image
  938.           still requires the same amount of memory, but takes
  939.           up less disk space.
  940.  
  941. Returns:  0 if succesful, 1 if it could not save the file
  942.  
  943. See also  wloadpak, wloadblock
  944.  
  945. wsavepcx256 procedure
  946. ------------------------------------------------------------------------------
  947. Function  Saves a block to disk in PCX compressed format.
  948.  
  949. Declaration    int wsavepcx256(char *filename,block blockname,color pal[256])
  950.  
  951. Remarks        This is similar to wsaveblock except that the image is
  952.       in a file which is compressed. The PCX compression method
  953.       is used. The more simplistic the image, the smaller the file.
  954.       The image still requires the same amount of memory, but takes
  955.       up less disk space. If the picture has many different colours
  956.       in it, sometime the PCX will be larger than a normal block.
  957.  
  958. See also  wloadpcx256, wloadblock
  959.  
  960.  
  961.  
  962. Mouse Functions:
  963. ~~~~~~~~~~~~~~~~
  964.  
  965.  
  966. minit procedure
  967. ------------------------------------------------------------------------------
  968. Function  Initializes the mouse.
  969.  
  970. Declaration    int minit(void);
  971.  
  972. Remarks        Simply starts up the mouse. You should use this first if you
  973.           want to use the mouse.
  974.  
  975. Returns:  Number of buttons on the mouse if driver is found.
  976.  
  977. See also  mon,moff,mread,noclick,msetbounds,mouseshape,msetspeed,
  978.           msetthreshhold
  979.  
  980.  
  981. moff procedure
  982. ------------------------------------------------------------------------------
  983. Function  Turns off display of the mouse cursor.
  984.  
  985. Declaration    void moff(void)
  986.  
  987. See also  minit,mon,mread,noclick,msetbounds,mouseshape,msetspeed,
  988.           msetthreshhold
  989.  
  990.         WordUp Graphics Toolkit Command Reference
  991.                 Page 16
  992.  
  993.  
  994. mon procedure
  995. ------------------------------------------------------------------------------
  996. Function  Displays the mouse cursor.
  997.  
  998. Declaration    void mon(void)
  999.  
  1000. Remarks        If the mouse is displayed while you are using some drawing
  1001.           procedures, it will mess up the screen if you move it over
  1002.           the area being updated.  Turn it off during all drawing
  1003.           procedures.
  1004.  
  1005. See also  minit,moff,mread,noclick,msetbounds,mouseshape,msetspeed,
  1006.           msetthreshhold
  1007.  
  1008.  
  1009.  
  1010. mouseshape procedure
  1011. ------------------------------------------------------------------------------
  1012. Function  Sets the bitmap and hotspot of the mouse cursor.
  1013.  
  1014. Declaration    void mouseshape(int rowhot,int colhot, void far *bitmap)
  1015.  
  1016. Remarks        This procedure sets the cursor hotspot as defined by the
  1017.           variables ROWHOT and COLHOT. Each are in the range (0..15).
  1018.           The hotspot is the place on the mouse cursor where
  1019.           the actual coordinates will be returned. Usually the
  1020.           hotspot is in the top left corner, but you are free
  1021.           to modify this depending on your mouse cursor shape.
  1022.           The actual bitmap information is stored in an array of
  1023.           integers called bitmap. It is defined as follows:
  1024.  
  1025.           The first 16 words are used to set the cursor shape, while the
  1026.           last 16 words set the mask. Several shareware programs are
  1027.           available to create the data required for these cursors if
  1028.           you are unfamiliar with bit operations.
  1029.  
  1030.  
  1031. See also  minit,mon,moff,mread,noclick,msetbounds,msetspeed,
  1032.           msetthreshhold
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.         WordUp Graphics Toolkit Command Reference
  1057.                 Page 17
  1058.  
  1059.  
  1060. mread procedure
  1061. ------------------------------------------------------------------------------
  1062. Function  Returns the current button pressed, as well as X and Y
  1063.           coordinates.
  1064.  
  1065. Declaration    void mread(void)
  1066.  
  1067. Remarks        Three global variables are updated when you call this
  1068.           procedure.  mx and my are the mouse coordinates, and
  1069.           but is the button state.
  1070.           Buttons are commonly returned as 1 for left, 2 for right,
  1071.           and 4 for the middle button of a 3 button mouse. 0 is returned
  1072.           if none are pressed.
  1073.  
  1074.  
  1075. See also  minit,mon,moff,noclick,msetbounds,mouseshape,msetspeed,
  1076.           msetthreshhold
  1077.  
  1078.  
  1079.  
  1080.  
  1081. msetbounds procedure
  1082. ------------------------------------------------------------------------------
  1083. Function  Sets the area to confine the mouse cursor to.
  1084.  
  1085. Declaration    void msetbounds(int minx,int miny,int maxx,int maxy)
  1086.  
  1087. Remarks        The cursor will be restricted movement within the specified
  1088.           region after this routine is called.
  1089.  
  1090. See also  minit,mon,moff,mread,noclick,mouseshape,msetspeed,
  1091.           msetthreshhold
  1092.  
  1093.  
  1094.  
  1095. msetspeed procedure
  1096. ------------------------------------------------------------------------------
  1097. Function  Sets the speed of the mouse.
  1098.  
  1099. Declaration    void msetspeed(int x_speed,int y_speed)
  1100.  
  1101. Remarks        Sets the speed of the mouse in each direction. 10 is about
  1102.           average for both values.  1 is fast, 40 is slower.
  1103.           In other words, if you set the speed to be 40 for the x, and
  1104.           1 for the y, you will have to move the mouse a greater
  1105.           distance horizontally to move the cursor one pixel. On the
  1106.           other hand, you can move the cursor very quickly up and down.
  1107.  
  1108.  
  1109. See also  minit,mon,moff,mread,noclick,msetbounds,mouseshape,
  1110.           msetthreshhold
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.         WordUp Graphics Toolkit Command Reference
  1123.                 Page 18
  1124.  
  1125.  
  1126. msetthreshhold procedure
  1127. ------------------------------------------------------------------------------
  1128. Function  Sets the speed the mouse must be before it doubles its
  1129.           movements.
  1130.  
  1131. Declaration    void msetthreshhold(int speed)
  1132.  
  1133. See also  minit,mon,moff,mread,noclick,msetbounds,mouseshape,msetspeed
  1134.  
  1135.  
  1136.  
  1137. noclick procedure
  1138. ------------------------------------------------------------------------------
  1139. Function  Waits until all buttons are released.
  1140.  
  1141. Declaration    void noclick(void)
  1142.  
  1143. Remarks        This is useful if you want the user to click on a button,
  1144.           update something, and wait for another button click.
  1145.           Without this command, the user could hold down the button
  1146.           and the program will think you pressed it a bunch of times.
  1147.           Put this command in after you have found the user pressed
  1148.           a button.  Example:
  1149.           
  1150.           mread();
  1151.           if (but==1)
  1152.             {
  1153.             ctr++;
  1154.             noclick();
  1155.             }
  1156.  
  1157.  
  1158. See also  minit,mon,mread,msetbounds,mouseshape,msetspeed,
  1159.           msetthreshhold
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.         WordUp Graphics Toolkit Command Reference
  1189.                 Page 19
  1190.  
  1191.  
  1192. Screen Operations:
  1193. ~~~~~~~~~~~~~~~~~~
  1194.  
  1195. wcopyscreen procedure
  1196. ------------------------------------------------------------------------------
  1197. Function  Copies a section of one screen onto a different virtual page.
  1198.  
  1199. Declaration    void wcopyscreen(int x1,int y1,int x2,int y2,block source,
  1200.            int dx,int dy, block dest)
  1201.  
  1202. Remarks        This command can seem confusing, but is very powerful, and
  1203.           necessary when using multiple graphics pages. A second page
  1204.           must be initialized by getting a block with dimensions
  1205.           (0,0)-(319,199) before this command can be used.
  1206.  
  1207.           The area defined by (x1,y1,x2,y2) is copied from the screen
  1208.           described by SOURCE, and is placed with the upper left corner
  1209.           at (dx,dy) on the screen referred to by DEST. For example,
  1210.           to copy screen SECOND(entirely) to the screen FIRST, type
  1211.           wcopyscreen(0,0,319,199,SECOND,0,0,FIRST). The visual page
  1212.           can be accesed by replacing the destination or source with
  1213.           NULL.
  1214.  
  1215.            For example to copy FIRST to the visual page:
  1216.           wcopyscreen(0,0,319,199,FIRST,0,0,NULL);
  1217.            or the other way around:
  1218.           wcopyscreen(0,0,319,199,NULL,0,0,FIRST);
  1219.  
  1220.  
  1221.  
  1222. wnormscreen procedure
  1223. ------------------------------------------------------------------------------
  1224. Function  Sets the active page back to the original visual page
  1225.  
  1226. Declaration    void wnormscreen(void)
  1227.  
  1228. Remarks        This is used to return all drawing operations to the normal
  1229.           screen.
  1230.  
  1231. See also  wnewblock,wfreeblock
  1232.  
  1233.  
  1234.  
  1235. wsetscreen procedure
  1236. ------------------------------------------------------------------------------
  1237. Function  Makes all drawing procedures use a different video page
  1238.  
  1239. Declaration    void wsetscreen(block screenname)
  1240.  
  1241. Remarks        The screen must be first initialized by using wnewblock
  1242.           with coords 0,0 to 319,199.
  1243.  
  1244. See also  wnewblock,wfreeblock
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.         WordUp Graphics Toolkit Command Reference
  1255.                 Page 20
  1256.  
  1257.  
  1258. Text functions:
  1259. ~~~~~~~~~~~~~~~
  1260.  
  1261. wflashcursor procedure
  1262. ------------------------------------------------------------------------------
  1263. Function       Flash the cursor using the values set by wsetcursor and
  1264.             the global variable curspeed.
  1265.  
  1266. Declaration    void wflashcursor(void)
  1267.  
  1268. Remarks        Uses the cursor coordinates set by the global variables
  1269.             xc and yc. Curspeed is another global variable which can
  1270.             be set to change the flashing speed.
  1271.  
  1272.  
  1273.  
  1274. wfreefont procedure
  1275. ------------------------------------------------------------------------------
  1276. Function       Frees memory previously allocated for a font.
  1277.  
  1278. Declaration    void wfreefont(wgtfont yourfont)
  1279.  
  1280.  
  1281.  
  1282. wgettextheight procedure
  1283. ------------------------------------------------------------------------------
  1284. Function       Returns the maximum height of the string.
  1285.  
  1286. Declaration    int wgettextheight(char *printme,wgtfont prfont)
  1287.  
  1288.  
  1289.  
  1290.  
  1291. wgettextwidth procedure
  1292. ------------------------------------------------------------------------------
  1293. Function       Returns the width of the string.
  1294.  
  1295. Declaration    int wgettextheight(char *printme,wgtfont prfont)
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.         WordUp Graphics Toolkit Command Reference
  1321.                 Page 21
  1322.  
  1323.  
  1324. wgtprintf procedure
  1325. ------------------------------------------------------------------------------
  1326. Function       Similar to outtextxy only allows for type conversions
  1327.             using the same format as printf.
  1328.  
  1329. Declaration    void wgtprintf(int xloc,int yloc,wgtfont wgtprfon,char *fmt, ... )
  1330.  
  1331. Remarks        Allows the user to print to the screen using the same
  1332.             format as the printf command from Turbo C.
  1333.             The text is printed at the screen coordinates xloc,yloc,
  1334.             and uses the font wgtprfon. The format is the same as
  1335.             the printf command, so you can easily print numbers
  1336.             within strings very easily.
  1337.             Example:
  1338.  wgtprintf(30,40,bigfont,"Hello %s! You are %i years old.",name,years);
  1339.  
  1340.  
  1341.  
  1342. wloadfont procedure
  1343. ------------------------------------------------------------------------------
  1344. Function       Loads a WGT font and return a pointer to it.
  1345.  
  1346. Declaration    wgtfont wloadfont(char *fontfile)
  1347.  
  1348. Remarks        Fonts can be used with outtextxy, wgtprintf, or wstring.
  1349.             Custom fonts are created with the sprite creator,
  1350.             and converted to font files with spr2fnt.exe.
  1351.             Example:
  1352.           myfont=wloadfont("tiny.wfn");
  1353.  
  1354.  
  1355. See also       wouttextxy, wstring,wfreefont
  1356.  
  1357.  
  1358.  
  1359. wouttextxy procedure
  1360. ------------------------------------------------------------------------------
  1361. Function       Outputs a string of text on the graphics page at (x,y).
  1362.  
  1363. Declaration    void wouttextxy(int x,int y, char *string,wgtfont font)
  1364.  
  1365. Remarks        Same as BGI version except it uses bitmapped fonts.
  1366.                X/Y coordinate system may be 40*25 or 320*200 (see the
  1367.             wtextgrid procedure). Uses font for displaying custom
  1368.             characters. Use wloadfont to load in custom fonts.
  1369.             In place of the wgtfont, use NULL to display text with
  1370.             the default font (built in).
  1371.  
  1372. See also       wtextcolor, wtextbackground, wtextgrid, wtexttransparent,
  1373.             wtextcursor, wstring,wloadfont
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.         WordUp Graphics Toolkit Command Reference
  1387.                 Page 22
  1388.  
  1389.  
  1390. wsetcursor procedure
  1391. ------------------------------------------------------------------------------
  1392. Function       Sets the shape of the text cursor.
  1393.  
  1394. Declaration    void wsetcursor(int y,int y2)
  1395.  
  1396. Remarks        Y and Y2 coordinates are the coordinates for the upper and
  1397.             lower lines for a box 8 pixels wide. The X coordinates are
  1398.             fixed to 8 pixels wide. The cursor is not the hardware text
  1399.             cursor, but rather a software simulation which flashes during
  1400.             text input. A solid box would be (0,7).
  1401.  
  1402. See Also       wstring
  1403.  
  1404.  
  1405.  
  1406. wstring procedure
  1407. ------------------------------------------------------------------------------
  1408. Function       Reads in a string of text from the keyboard and displays
  1409.                both the text and a simulated cursor on the graphics page.
  1410.  
  1411. Declaration    int wstring(int x,int y, char *instring, char *legal, int num,wgtfont
  1412. font)
  1413.                
  1414. Remarks        X and Y are the coordinates to read the string in from.
  1415.             This procedure uses the flashing cursor while you input the
  1416.             string. Any characters you wish to be able to type in must
  1417.             be included in LEGAL.  For example, if you want a yes or
  1418.             no answer only, make LEGAL="YNyn". NUM is the maximum number
  1419.             of letters in the string.
  1420.  
  1421.             INSTRING must be a pointer to char, example
  1422.                char *filename;
  1423.             Along with legal:
  1424.                char *legal_chars = " ABCDEFGHIJKLMNOPQRSTUVWXYZ
  1425.                   abcdefghijklmnopqrstuvwxyz1234567890_.";
  1426.           
  1427.             Then, you must allocate memory for the string, like this:
  1428.                filename = (char *) malloc (13);
  1429.             Add 1 to the length for the null terminator.
  1430.  
  1431.             Call the string procedure:
  1432.                  wstring(10,22,filename,legal_chars,12);
  1433.  
  1434.             After you're done with the string, free the memory by
  1435.                free(filenameout);
  1436.  
  1437.             INSERT,DELETE,HOME,END and the arrow keys are functional,
  1438.             backspace is destructive.
  1439.             If you press insert, the cursor shape changes and toggles
  1440.             between insert and overwrite modes.
  1441.  
  1442. See Also       wtextcolor, wtextbackground, wtextgrid, wtexttransparent
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.         WordUp Graphics Toolkit Command Reference
  1453.                 Page 23
  1454.  
  1455.  
  1456. wtextbackground procedure
  1457. ------------------------------------------------------------------------------
  1458. Function       Sets the background text color.
  1459.  
  1460. Declaration    void wtextbackground(unsigned char color)
  1461.  
  1462. Remarks        Color is in the range (0..255). Background may be turned off
  1463.             for output by using wtexttransparent.
  1464.  
  1465. See also       wouttextxy,wtextcolor, wtextgrid,
  1466.             wtexttransparent, wtextcursor, wstring
  1467.  
  1468.  
  1469.  
  1470. wtextcolor procedure
  1471. ------------------------------------------------------------------------------
  1472. Function       Selects the foreground character color.
  1473.  
  1474. Declaration    void wtextcolor(unsigned char color)
  1475.  
  1476. Remarks        Color is in the range (0..255). Foreground may be turned off
  1477.             during output by setting wtexttransparent.
  1478.  
  1479. See also       wouttextxy, wtextbackground, wtextgrid,
  1480.             wtexttransparent, wtextcursor, wstring
  1481.  
  1482.  
  1483.  
  1484. wtextgrid procedure
  1485. ------------------------------------------------------------------------------
  1486. Function       Switches the text addressing system from 320*200 to 40*25.
  1487.  
  1488. Declaration    void wtextgrid(int state)
  1489.  
  1490. Remarks        Text may be output in regular graphics coordinates (320*200) or
  1491.             a text mode system of 40*25. If STATE is set to 1, all input
  1492.             and output values for WGT text functions are expected to be
  1493.             in the 40*25 range. Characters will be 'snapped' to the grid as
  1494.             if it were a text mode. 0 will use regular graphics system
  1495.             coordinates.
  1496.  
  1497. See Also       wouttextxy, wstring
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.         WordUp Graphics Toolkit Command Reference
  1519.                 Page 24
  1520.  
  1521.  
  1522. wtexttransparent procedure
  1523. ------------------------------------------------------------------------------
  1524. Function       Sets text output to supress display of foreground or
  1525.                background.
  1526.  
  1527. Declaration    void wtexttransparent(int mode)
  1528.  
  1529. Remarks        This will turn off the display of either the foreground or the
  1530.             background, or set it to show both.
  1531.             The values possible are:
  1532.             0: Background turned off
  1533.             1: Foreground turned off
  1534.             2: Both turned on
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540. Special Effects
  1541. ~~~~~~~~~~~~~~~
  1542.  
  1543. wfade     procedure
  1544. ------------------------------------------------------------------------------
  1545. Function  Dissolves a screen of memory onto the active screen.
  1546.  
  1547. Declaration    void wfade(block sourcescreen, int *pattern, int speed)
  1548.  
  1549. Remarks        The screen described by SOURCESCREEN is dissolved onto the
  1550.           active screen set by wsetscreen using the pattern specified
  1551.           by pattern. Pattern is an array of integer.  It can be
  1552.           defined by the program called dissolve.exe, included with
  1553.           WGT. After saving a pattern with this program, include the
  1554.           code generated with your program, and pass it the array to
  1555.           this procedure.
  1556.           The speed is a DELAY command after each pixel is copied.
  1557.  
  1558.  
  1559.  
  1560. wmovescreen procedure
  1561. ------------------------------------------------------------------------------
  1562. Function       Moves an area of the screen in one of four directions.
  1563.  
  1564. Declaration    void wmovescreen(int x1, int y1, int x2, int y2, int dir,
  1565.          int amt)
  1566.  
  1567. Remarks           This is a quick way to scroll an area of the screen by
  1568.            different amounts.  Not recommended for scrolling in games.
  1569.            DIR: 0=up  1=down  2=left   3=right    
  1570.  
  1571. wpan procedure
  1572. ------------------------------------------------------------------------------
  1573. Function       Changes the offset of the visual screen.
  1574.  
  1575. Declaration    void wpan(int offset)
  1576.  
  1577. Remarks          This can be used for special effects to make the screen
  1578.             shake. Each row contains 320 pixels across. Therefore
  1579.             the screen will shift up one if the offset is 320.
  1580.             Offsets with multiples of 320 will shift the screen
  1581.             up or down, and other offsets with move left or right.
  1582.             For a shaking effect, use small offsets (0-5).
  1583.  
  1584.         WordUp Graphics Toolkit Command Reference
  1585.                 Page 25
  1586.  
  1587.  
  1588. wresize procedure
  1589. ------------------------------------------------------------------------------
  1590. Function  Draws a previously stored image on the screen to fit within a
  1591.       given boundary.
  1592.  
  1593. Declaration    void wresize(int x1,int y1,int x2,int y2, block blockname);
  1594.  
  1595. Remarks        A very fast shrink/expand routine for blocks. It will redraw
  1596.           an image to fit perfectly within the area defined by
  1597.           (x1,y1,x2,y2). In this manner, entire screens can be shrunk
  1598.           down as icons, or small images can "explode". Image in memory
  1599.           is not affected.
  1600.  
  1601.  
  1602. wskew procedure
  1603. ------------------------------------------------------------------------------
  1604. Function  Skews a block sideways
  1605.  
  1606. Declaration    void wskew(int x,int y,block skewblock,int degrees)
  1607.  
  1608. Remarks        Quickly skews a block by a certain number of degrees
  1609.           sideways. Excellent for special FX.
  1610.  
  1611.  
  1612. wsline procedure
  1613. ------------------------------------------------------------------------------
  1614. Function  Operates with the wwarp command. Stores the points of a line
  1615.           into an array instead of plotting them on the screen.
  1616.  
  1617. Declaration    void wsline(int x1,int y1,int x2,int y2,int *ptarray);
  1618.  
  1619. Remarks        Simply stores the y coordinate values in the appropriate
  1620.           place in the array for every x coordinate on a line.
  1621.           See wwarp for more info...
  1622.  
  1623.  
  1624.  
  1625.  
  1626. wvertres procedure
  1627. ------------------------------------------------------------------------------
  1628. Function  Draws a previously stored image on the screen to fit within a
  1629.           given boundary. Only stretches Y coordinates...much faster!
  1630.  
  1631. Declaration    void wvertres(int x1,int y1,int y2, block blockname);
  1632.  
  1633. Remarks        An extremely fast shrink/expand routine for blocks.
  1634.           Similar to wresize but doesn't change the width of
  1635.           the block. Use this at all times if you are only
  1636.           resizing the height, since it is much faster.
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.         WordUp Graphics Toolkit Command Reference
  1651.                 Page 26
  1652.  
  1653.  
  1654. wwarp procedure
  1655. ------------------------------------------------------------------------------
  1656. Function  Displays a block on the screen, using different heights
  1657.       for each column displayed.
  1658.  
  1659. Declaration    void wwarp(int x1,int x2,int *top,int *bot, block blockname);
  1660.  
  1661. Remarks   Instead of drawing the block straight across in a
  1662.           rectangular manner, this function resizes the block
  1663.           vertically for every column displayed. You can have
  1664.           each column stretched by different amounts allowing
  1665.           for some very interesting effects.
  1666.           X1 and X2 are the two x coordinates the block
  1667.           will be resized between. Top and bot are 320 integer
  1668.           arrays which hold the y values for every x coordinate.
  1669.           Blockname is the block to warp.
  1670.  
  1671.           Use wsline to set up the top and bot arrays if you
  1672.           are using straight lines.
  1673.  
  1674.   Example:      wsline(0,199,319,0,&top);   // sets up line for top
  1675.         wsline(0,199,319,199,&bot); // sets up bottom line
  1676.         // Imagine drawing these two lines on the screen...
  1677.  
  1678.           wwarp(0,319,&top,&bot,warp_block);
  1679.  
  1680.           The warped block would look like this:
  1681.  
  1682.           |-----------------------------|
  1683.           |                          /--|
  1684.           |                      /--/ i |
  1685.           |                  /--/ i i i |
  1686.           |              /--/ i i i i i |
  1687.           |          /--/ i i i i i i i |
  1688.           |      /--/ i i This is the i |
  1689.           |  /--/ i i i i warped blocki |
  1690.           |/i i i i i i i i i i i i i i |
  1691.           |-----------------------------|
  1692.  
  1693.      Top should have all points above the corresponding point in bot.
  1694. The block is resized between these points on the screen. This method
  1695. is fairly slow. If you register WGT 3.0, you will receive full source
  1696. code for a faster routine which requires more memory. (20k)
  1697.  
  1698. You do not need to use wsline to make straight lines for warping.
  1699. Other possibilities include zig-zags, sine waves, etc... Just
  1700. put your own numbers into the top and bot arrays and call wwarp.
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.         WordUp Graphics Toolkit Command Reference
  1717.                 Page 27
  1718.  
  1719.  
  1720. wwipe     procedure
  1721. ------------------------------------------------------------------------------
  1722. Function  Draws a line but uses colours from another virtual screen.
  1723. Declaration    void wwipe(int x1,int y1, int x2,iny y2,block screen)
  1724.  
  1725. Remarks        This special effect allows you to draw a line on the screen,
  1726.           but instead of using one colour, each pixel drawn is the
  1727.           colour of the pixel at the same location on the block
  1728.           screen. You can created impressive wipes and make your
  1729.           programs look very professional.  You will want to make
  1730.           one or more 'for' statements that copy the whole screen over
  1731.           since this only does it one at a time.  The lines don't have
  1732.           to be horizontal or vertical, so you can create complex
  1733.           patterns with the lines.
  1734.  
  1735.  
  1736.  
  1737. Sprite Procedures:
  1738. ~~~~~~~~~~~~~~~~~~
  1739. wloadsprites procedure
  1740. --------------------------------------------------------------------------
  1741. Function       Loads in a sprite file
  1742.  
  1743. Declaration    int wloadsprites(color *palette,char *filename,                       
  1744.       block sprites[1001]);
  1745.  
  1746.      Loads a sprite file create with the WGT Sprite Creator.
  1747.      Returns -1 if unsuccessful or 0 if successful
  1748.  
  1749.      Example usage:
  1750.           ok=wloadsprites(&palette,"game.spr",sprites);
  1751.  
  1752.  
  1753.  
  1754. wfreesprites procedure
  1755. --------------------------------------------------------------------------
  1756. Function       Frees memory from sprites
  1757.  
  1758. Declaration    void wfreesprites(block sprites[1001]);
  1759.      
  1760.      Frees memory previously allocated from loadsprites.
  1761.  
  1762.      Example usage:
  1763.           wfreesprites(sprites);
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.         WordUp Graphics Toolkit Command Reference
  1783.                 Page 28
  1784.  
  1785.  
  1786.  
  1787. WGT Library functions:
  1788. ~~~~~~~~~~~~~~~~~~~~~~
  1789.  
  1790. setlib procedure
  1791. ------------------------------------------------------------------------------
  1792. Function       Sets the WGT library name.
  1793.  
  1794. Declaration    void setlib(char *libname)
  1795.  
  1796. Remarks        WGT has the ability to store all of your graphics
  1797.             or data files into one large library file. Use the
  1798.             utility called wgtlib to manage your WGT library
  1799.             files. These library files are not the library
  1800.             files made by TLIB. Set the name of the library
  1801.             file in the beginning of your program, and all
  1802.             WGT commands which load something in will use the
  1803.             library instead of individual files.
  1804.         Use WGTLIB.EXE to create WGT Library files.
  1805.  
  1806.  
  1807. See also       getlib,setpassword,lib2buf
  1808.  
  1809.  
  1810. getlib procedure
  1811. ------------------------------------------------------------------------------
  1812. Function       Gets the WGT library name.
  1813.  
  1814. Declaration    char *getlib(void)
  1815.  
  1816. Remarks        Returns the name of the WGT library file in use.
  1817.  
  1818.  
  1819. See also       setlib,setpassword,lib2buf
  1820.  
  1821.  
  1822. setpassword procedure
  1823. ------------------------------------------------------------------------------
  1824. Function       Sets the WGT library password.
  1825.  
  1826. Declaration    void setpassword(char *newpassword)
  1827.  
  1828. Remarks        WGT library files can be protected by a password.
  1829.             If you choose the incorrect password, files cannot
  1830.             be loaded in or modified.
  1831.  
  1832.  
  1833.  
  1834. See also       getlib,setlib,lib2buf
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.         WordUp Graphics Toolkit Command Reference
  1849.                 Page 29
  1850.  
  1851.  
  1852. lib2buf procedure
  1853. ------------------------------------------------------------------------------
  1854. Function       Allocates memory for a file, and loads it into memory.
  1855.  
  1856. Declaration    void *lib2buf(char *filename)
  1857.  
  1858. Remarks          This allows any type of file to be loaded into
  1859.             memory from the WGT library file. It gets the required
  1860.             memory first, and then returns a pointer to the
  1861.             data. It can be used for many things, such as
  1862.             text data, sound blaster voc's, cmf files, rol files,
  1863.             and any other data.
  1864.  
  1865.  
  1866. See also       getlib,setpassword,setlib
  1867.  
  1868.  
  1869. Timing control
  1870. ~~~~~~~~~~~~~~
  1871.  
  1872. int wtimer(struct time t,struct time t2)
  1873. -------------------------------------------------------------------------
  1874. Returns: Hundredths of seconds between the two times.
  1875.  
  1876.     Use gettime to store the timing variables first, and call this
  1877. routine to see how long it took to execute a command or procedure.
  1878. For measuring the frame rate of an animation, count the number of times
  1879. the screen is updated, and store the time it took. To find the number of
  1880. frames per second, divide the number of updates by the time.
  1881. To find the average time it took for each frame, perform the reverse.
  1882.  
  1883. This routine can be used to control the timing of animation on different
  1884. computer systems.  Fast computers will need to be slowed down to
  1885. stay at the prefered speed.
  1886.  
  1887.  
  1888.  
  1889. WGT Joystick Routines
  1890. ~~~~~~~~~~~~~~~~~~~~~
  1891. ***Joystick routines are contained in wgtjoy.lib***
  1892.  
  1893. int wcheckjoystick(void)
  1894. -------------------------------------------------------------------------
  1895. Checks for the presence of each joystick. Returns an integer with 2 bits
  1896. set. If bit 1 is set, joystick 1 has been found. If bit 2 is set, joystick
  1897. 2 has been found.
  1898.  
  1899.  
  1900. void winitjoystick(joystick *joy, int joynum)
  1901. -------------------------------------------------------------------------
  1902. Initializes joystick number joynum. Assumes the joystick is centered.
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.         WordUp Graphics Toolkit Command Reference
  1915.                 Page 30
  1916.  
  1917. void wcalibratejoystick(joystick *joy)
  1918. -------------------------------------------------------------------------
  1919. Calibrates joystick before being used. To calibrate, you must call
  1920. this once with the joystick to the upper left, and again with the joystick
  1921. to the lower right. This will set the appropriate scale and range of the
  1922. joystick.
  1923.  
  1924. If you want to calibrate the joystick in a setup program, you can
  1925. save all the calibrated values in a configuration file, and load them
  1926. back in for your main program. This way the user only has to calibrate
  1927. the joystick once.
  1928.  
  1929. Here is the structure data you must save:
  1930. typedef struct {
  1931.     int x,y;
  1932.     int cenx,ceny;
  1933.     int xrange,yrange;
  1934.     int port,buttons;
  1935.     int scale;
  1936.     } joystick;
  1937.  
  1938.  
  1939. int wreadjoystick(joystick *joy)
  1940. -------------------------------------------------------------------------
  1941. Reads the X, Y, and button status for a joystick.
  1942. To read each value, use joy.x,joy.y,joy.buttons.
  1943.  
  1944.  
  1945.